<?php
/**
 * Created by PhpStorm.
 * User: zjw
 * Date: 2018/3/26
 * Time: 上午11:06
 */

namespace console\controllers;

use console\models\Admin;
use yii\console\Controller;
use yii;

class AdminController extends Controller
{
    public function actionResetPassword()
    {
        $password = 'juPNQkdppo';
        $admin = Admin::find()->where(['username' => 'lianluo'])->one();
        $admin->setPassword($password);
        if ($admin->save()) {
            echo "管理员账号已重置:　lianluo/$password\n";
        }
    }
}
